package cn.edu.lcu.cs.javateaching.io;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Game {
	public static void main(String[] args) throws IOException {
		boolean n = false;
		int num = 1;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int i = 0;
		while (i < 5) {
			System.out.println("请输入密码:(第" + num + "次输入)");
			num++;
			String password = br.readLine();
			i++;
			if (password.equals("123456")) {
				System.out.print("恭喜你进入游戏");
				n = true;
				break;
			}
		}
		if (!n) {
			System.out.print("密码错误，游戏结束");
		}
	}
}